/**
 * Created with IDEA
 * author:ju bai
 * Date:2021/1/26
 * Time:8:59
 **/


public class Main {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BTNode root = binaryTree.createTree();
        binaryTree.preOrderTraversal(root);
        System.out.println();
        binaryTree.preOrderTraversal2(root);
        System.out.println();
        binaryTree.inOrderTraversal(root);
        System.out.println();
        binaryTree.inOrderTraversal2(root);
        System.out.println();
        binaryTree.postOrderTraversal(root);
        System.out.println();
        binaryTree.postOrderTraversal2(root);
        System.out.println();
        binaryTree.levelOrderTraversal(root);
        System.out.println();

        binaryTree.getSize1(root);
        System.out.println(binaryTree.getSize2(root));
        binaryTree.getLeafSize1(root);
        System.out.println(binaryTree.getLeafSize2(root));
        System.out.println(binaryTree.getKLevelSize(root,4));
        System.out.println(binaryTree.getHeight(root));
        BTNode ret = binaryTree.find(root, 'T');
        if(ret == null){
            System.out.println("未找到！");
        }else {
            System.out.println(ret.val);
        }
        System.out.println(binaryTree.isCompleteTree(root));
    }
}
